//写cookies 
function setCookie(name,value) 
{ 
    document.cookie = name + "="+ escape (value) + ";expires=0;path=/"; 
} 
//读取cookies 
function getCookie(name) 
{ 
    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg)){
		return unescape(arr[2]);
	} else {
		return null; 
	}
} 
//删除cookies 
function delCookie(name) 
{ 
	setCookie(name,'');
}